package com.vizhuo.client.base;

import java.io.Serializable;

public abstract class AbstractReply1 implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = -7715922890245840677L;

    /**
     * 流水号
     */
    private long serialNumber;

    /**
     * 返回结果CODE
     */
    private String returnCode;

    /**
     * 返回结果的描述
     */
    private String returnMessage;

    /**
     * 用来做请求的有效性验证或登录状态
     */
    private String loginToken;

    /**
     * 返回结果CODE
     * 
     * @return
     */
    public String getReturnCode() {
        return returnCode;
    }

    /**
     * 返回结果CODE
     * 
     * @param returnCode
     */
    public void setReturnCode(String returnCode) {
        this.returnCode = returnCode;
    }

    /**
     * 返回结果的描述
     * 
     * @return
     */
    public String getReturnMessage() {
        return returnMessage;
    }

    /**
     * 返回结果的描述
     * 
     * @param returnMessage
     */
    public void setReturnMessage(String returnMessage) {
        this.returnMessage = returnMessage;
    }

    /**
     * 流水号
     * 
     * @return
     */
    public long getSerialNumber() {
        return serialNumber;
    }

    /**
     * 流水号
     * 
     * @param serialNumber
     */
    public void setSerialNumber(long serialNumber) {
        this.serialNumber = serialNumber;
    }

    public AbstractReply1(long serialNumber) {
        super();
        this.serialNumber = serialNumber;
        this.returnCode = AbstractReturnCodeConstant.SYS_SUCCESS;
        this.returnMessage = AbstractReturnCodeConstant.messageMap.get(this.returnCode);
    }

    public AbstractReply1() {
        super();
        this.returnCode = AbstractReturnCodeConstant.SYS_SUCCESS;
        this.returnMessage = AbstractReturnCodeConstant.messageMap.get(this.returnCode);
    }

    public boolean checkSuccess() {
        if (this.returnCode.equals(AbstractReturnCodeConstant.SYS_SUCCESS)) {
            return true;
        } else {
            return false;
        }
    }

    /**
     * 用来做请求的有效性验证或登录状态
     * 
     * @return
     */
    public String getLoginToken() {
        return loginToken;
    }

    /**
     * 用来做请求的有效性验证或登录状态
     * 
     * @param loginToken
     */
    public void setLoginToken(String loginToken) {
        this.loginToken = loginToken;
    }

}
